//
//  XMAlbumSubsubModel.m
//  XiaoMiao
//
//  Created by jinglian on 2018/2/11.
//  Copyright © 2018年 smallyou. All rights reserved.
//

#import "XMAlbumSubsubModel.h"
#import "XMAlbumSubCell.h"

@implementation XMAlbumSubsubModel


+(NSDictionary*)modelContainerPropertyGenericClass{
    
    return @{@"photographUserAngleRefViews":[AlbumImageModel class]};
    
}


- (CGFloat)photoCellHeight {
    return [XMAlbumSubCell topViewH] + self.photoAlbumViewH;
}

- (CGFloat)photoAlbumViewH {
    if (!_isFoldAlubm) {
        return 0;
    }
    
    if (_photoAlbumViewH != 0) {
        return _photoAlbumViewH;
    }
    
    CGFloat albumW = (kScreenWidth - (10 * 2) - (5 * 3)) * 1.0 / 4.0;
    NSInteger colum = 0;
    if (_photographUserAngleRefViews.count % 4) {
        colum = (int)(_photographUserAngleRefViews.count / 4)+1;
    }else{
        colum = (int)(_photographUserAngleRefViews.count / 4);
    }
 
    CGFloat collectionViewH = 5 * (colum - 1) + albumW * colum;
    
    return 5 + 10 + collectionViewH;
}

- (CGFloat)compareCellHeight {
    return [XMAlbumSubCell topViewH] + self.compareAlbumViewH;
}

- (CGFloat)compareAlbumViewH {
    if (!_isFoldAlubm) {
        return 0;
    }
    
    if (_compareAlbumViewH != 0) {
        return _compareAlbumViewH;
    }
    
    CGFloat albumH = (kScreenWidth - (10 * 2) - 5) * 1.0 / 4.0;
    
    
    NSInteger colum = (int)(_photographUserAngleRefViews.count / 2);
    if (_photographUserAngleRefViews.count % 2) {
        colum = colum + 1;
    }
    CGFloat collectionViewH = 5 * (colum - 1) + albumH * colum;
    
    return 5 + 10 + collectionViewH;
}

@end

@implementation XMAlbumNewSubSubRemarkModel

@end

